package models

import (
	"gin-app/app/common"
)

// Collection 收藏模型
type Collection struct {
	common.ID
	UserId   string `json:"user_id" gorm:"not null;index;comment:用户id"`
	BookName string `json:"book_name" gorm:"not null;comment:书籍名称"`
	BookId   string `json:"book_id" gorm:"not null;index;comment:书籍id"`
	common.Timestamps
	common.SoftDeletes
}

func NewCollection(userId, bookName, bookId string) *Collection {
	return &Collection{
		UserId:   userId,
		BookName: bookName,
		BookId:   bookId,
	}
}
